unit uBasicChild;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, ComCtrls, ToolWin, Grids, DBGridEh, StdCtrls, DB;

type
  TfBasicChild = class(TForm)
    GroupBox1: TGroupBox;
    DBGridEh: TDBGridEh;
    tbBasicChild: TToolBar;
    tbbAddBasicChild: TToolButton;
    tbbDelBasicChild: TToolButton;
    procedure tbbAddBasicChildClick(Sender: TObject);
    procedure tbbDelBasicChildClick(Sender: TObject);
  private
    { Private declarations }
  public
    procedure SetData(FormCaption, GroupBoxCaption: String; DataSource: TDataSource);
  end;

var
  fBasicChild: TfBasicChild;

implementation

uses uDBData;

{$R *.dfm}

procedure TfBasicChild.SetData(FormCaption, GroupBoxCaption: String; DataSource: TDataSource);
begin
  Caption := FormCaption;
  GroupBox1.Caption := GroupBoxCaption;
  DBGridEh.DataSource := DataSource;
end;

procedure TfBasicChild.tbbAddBasicChildClick(Sender: TObject);
begin
  fDBData.InsertRecord(DBGridEh.DataSource);
end;

procedure TfBasicChild.tbbDelBasicChildClick(Sender: TObject);
begin
  fDBData.DeleteRecord(DBGridEh.DataSource);
end;

end.
